package com.smartsystem.modules.system.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 用户注册请求DTO类
 */
@Data
@Schema(description = "用户注册请求")
public class RegisterDTO {
    
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Size(min = 2, max = 50, message = "用户名长度必须在2-50个字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母、数字和下划线")
    @Schema(description = "用户名", example = "newuser", required = true)
    private String username;
    
    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20个字符之间")
    @Schema(description = "密码", example = "123456", required = true)
    private String password;
    
    /**
     * 确认密码
     */
    @NotBlank(message = "确认密码不能为空")
    @Schema(description = "确认密码", example = "123456", required = true)
    private String confirmPassword;
    
    /**
     * 真实姓名
     */
    @NotBlank(message = "真实姓名不能为空")
    @Size(min = 2, max = 20, message = "真实姓名长度必须在2-20个字符之间")
    @Schema(description = "真实姓名", example = "张三", required = true)
    private String realName;
    
    /**
     * 性别 1-男 2-女
     */
    @NotNull(message = "性别不能为空")
    @Min(value = 1, message = "性别值必须为1或2")
    @Max(value = 2, message = "性别值必须为1或2")
    @Schema(description = "性别 1-男 2-女", example = "1", required = true)
    private Integer gender;
    
    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Schema(description = "手机号", example = "13800138000", required = true)
    private String phone;
    
    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不正确")
    @Schema(description = "邮箱", example = "user@example.com")
    private String email;
    
    /**
     * 部门
     */
    @Schema(description = "部门", example = "销售部")
    private String department;
    
    /**
     * 职位
     */
    @Schema(description = "职位", example = "销售员")
    private String position;
}